/**
 * Copyright (c) 2015-2030 by Beijing Yanlight Co., Ltd.
 * All rights reserved.
 */
package com.yanlight.app.dal.entity;

import java.util.List;

import org.apache.commons.lang3.StringUtils;

import com.yanlight.type.BooleanType;
import com.yanlight.type.StatusType;
import com.yanlight.util.JsonUtil;

/**
 * 商品
 * 
 * @author haolw
 * @time 2017/11/28
 */
public class ShopGoods {
	private Integer id;
	private Integer companyId;
	private String sn;// 商品sn
	private Integer parentCategoryId;// 一级类目
	private Integer subCategoryId;// 二级类目
	private String name;
	private String searchKeywords;// 该商品的搜索关键字
	private String specification;// 商品规格
	private Double originalPrice;// 原价
	private Double promotionalPrice;// 促销价
	private Integer recommend = BooleanType.FALSE.ordinal();// 是否推荐
	private Integer hotSale = BooleanType.FALSE.ordinal();// 是否热卖
	private Integer specialSale = BooleanType.FALSE.ordinal();// 是否特卖
	private Integer newProduct = BooleanType.FALSE.ordinal();// 是否新品
	private Integer sales = 0;// 售出数量
	private Integer stock = 0;// 库存
	private String thumbnail;// 商品缩略图
	private String swiperImg;// 商品轮播图
	private String detailImg;// 商品详情图
	private Integer status = StatusType.ACTIVITY.ordinal();// 上下架状态
	private Integer forceOffShelf = BooleanType.FALSE.ordinal();// 是否强制下架
	private String createTime;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getCompanyId() {
		return companyId;
	}

	public void setCompanyId(Integer companyId) {
		this.companyId = companyId;
	}

	public String getSn() {
		return sn;
	}

	public void setSn(String sn) {
		this.sn = sn;
	}

	public Integer getParentCategoryId() {
		return parentCategoryId;
	}

	public void setParentCategoryId(Integer parentCategoryId) {
		this.parentCategoryId = parentCategoryId;
	}

	public Integer getSubCategoryId() {
		return subCategoryId;
	}

	public void setSubCategoryId(Integer subCategoryId) {
		this.subCategoryId = subCategoryId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getSearchKeywords() {
		return searchKeywords;
	}

	public void setSearchKeywords(String searchKeywords) {
		this.searchKeywords = searchKeywords;
	}

	public String getSpecification() {
		return specification;
	}

	public void setSpecification(String specification) {
		this.specification = specification;
	}

	public Double getOriginalPrice() {
		return originalPrice;
	}

	public void setOriginalPrice(Double originalPrice) {
		this.originalPrice = originalPrice;
	}

	public Double getPromotionalPrice() {
		return promotionalPrice;
	}

	public void setPromotionalPrice(Double promotionalPrice) {
		this.promotionalPrice = promotionalPrice;
	}

	public Integer getRecommend() {
		return recommend;
	}

	public void setRecommend(Integer recommend) {
		this.recommend = recommend;
	}

	public Integer getHotSale() {
		return hotSale;
	}

	public void setHotSale(Integer hotSale) {
		this.hotSale = hotSale;
	}

	public Integer getSpecialSale() {
		return specialSale;
	}

	public void setSpecialSale(Integer specialSale) {
		this.specialSale = specialSale;
	}

	public Integer getNewProduct() {
		return newProduct;
	}

	public void setNewProduct(Integer newProduct) {
		this.newProduct = newProduct;
	}

	public Integer getSales() {
		return sales;
	}

	public void setSales(Integer sales) {
		this.sales = sales;
	}

	public Integer getStock() {
		return stock;
	}

	public void setStock(Integer stock) {
		this.stock = stock;
	}

	public String getThumbnail() {
		return thumbnail;
	}

	public void setThumbnail(String thumbnail) {
		this.thumbnail = thumbnail;
	}

	public String getSwiperImg() {
		return swiperImg;
	}

	public void setSwiperImg(String swiperImg) {
		this.swiperImg = swiperImg;
	}

	public List<String> getSwiperImgs() {
		if (StringUtils.isNotBlank(swiperImg)) {
			return JsonUtil.parseArray(swiperImg, String.class);
		}
		return null;
	}

	public void setSwiperImgs(List<String> swiperImgs) {
		if (swiperImgs != null && !swiperImgs.isEmpty()) {
			this.swiperImg = JsonUtil.toJson(swiperImgs);
		}
	}

	public String getDetailImg() {
		return detailImg;
	}

	public void setDetailImg(String detailImg) {
		this.detailImg = detailImg;
	}

	public List<String> getDetailImgs() {
		if (StringUtils.isNotBlank(detailImg)) {
			return JsonUtil.parseArray(detailImg, String.class);
		}
		return null;
	}

	public void setDetailImgs(List<String> detailImgs) {
		if (detailImgs != null && !detailImgs.isEmpty()) {
			this.detailImg = JsonUtil.toJson(detailImgs);
		}
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Integer getForceOffShelf() {
		return forceOffShelf;
	}

	public void setForceOffShelf(Integer forceOffShelf) {
		this.forceOffShelf = forceOffShelf;
	}

	public String getCreateTime() {
		return createTime;
	}

	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}
}
